﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Generic;

namespace ChatServer
{
    class ServerModel
    {
        List<Room> m_roomList;

        public ServerModel()
        {
            m_roomList = new List<Room>();
            Room room1 = new Room("General");
            m_roomList.Add(room1);
            Room room2 = new Room("Fun");
            m_roomList.Add(room2);
            Room room3 = new Room("XXX");
            m_roomList.Add(room3);

        }

        public void messageReceived(string message, string roomname)
        {
            
        }

        public void addUser(string username)
        {
            
            
        }

        public void removeUser(string username)
        {
            
        }

        public void joinRoom(string user, string room)
        {
            if (room == "General")
            {
                m_roomList[0].addUser(user);
            }
            if (room == "Fun")
            {
                m_roomList[1].addUser(user);
            }
            if (room == "XXX")
            {
                m_roomList[2].addUser(user);
            }
        }
    }
}
